package com.ffmpeg.learn;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.view.SurfaceHolder;

import java.io.File;


public class XPlay extends GLSurfaceView implements Runnable,SurfaceHolder.Callback {

    public XPlay(Context context, AttributeSet attrs) {
        super( context,attrs );
    }

    @Override
    public void run() {
//        File path = getExternalFilesDir(null);
////        File path = getFilesDir();
//        String file = path +"/1080.mp4";
        Open("/storage/emulated/0/Android/data/com.ffmpeg.learn/files/1080.mp4",getHolder().getSurface());
    }
    @Override
    public void surfaceCreated(SurfaceHolder var1){
        new Thread( this ).start();
    }

    @Override
    public void surfaceChanged(SurfaceHolder var1, int var2, int var3, int var4){

    }

    @Override
    public void surfaceDestroyed(SurfaceHolder var1){

    }
    public native void Open(String url,Object surface);
}
